<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>读者管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">

		function selectAdmin(rdId, rdCardno,rdName,rdState,rdRoleId,rdTele) {

			try {
				$("#rdId", window.opener.document).val(rdId);
				$("#rdSn", window.opener.document).val(rdCardno);


				$("#info_rdId", window.opener.document).val(rdId);
				$("#info_rdName", window.opener.document).val(rdName);
				$("#info_rdState", window.opener.document).val(rdState);
				$("#info_rdRoleId", window.opener.document).val(rdRoleId);
				$("#info_rdTele", window.opener.document).val(rdTele);
			}
			catch (e) {
				// 防止父页面没有此方法导致报错
			}
			window.close();
			return false;
		}

		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
			return false;
		}
	</script>
</head>
<body>

<form:form id="searchForm" modelAttribute="reader" action="${ctx}/book/reader/listData" method="post" class="breadcrumb form-search ">
	<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
	<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
	<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}" callback="page();"/>
	<ul class="ul-form">
		<li><label>读者编号：</label>
			<form:input path="rdId" htmlEscape="false" maxlength="50" class="input-medium"/>
		</li>
		<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" onclick="return page();"/>
			</li>
		<li class="clearfix"></li>
	</ul>
</form:form>
<sys:message content="${message}"/>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
	<thead>
	<tr>
		<th>读者编号</th>
		<th>借书证号</th>
		<th>读者姓名</th>
		<th>联系电话</th>
		<th>读者性别</th>
		<th>出生日期</th>
		<th>办证日期</th>
		<th>有效日期</th>
		<th>读者状态</th>
		<th>读者角色</th>
		<th>操作</th>
	</thead>
	<tbody>
	<c:forEach items="${page.list}" var="rdlist">
		<tr>
			<td>${rdlist.rdId}</td>
			<td>${rdlist.rdCardno}</td>
			<td>${rdlist.rdName}</td>
			<td>${rdlist.rdTele}</td>
			<td>${fns:getDictLabel(rdlist.rdSex, 'sex', '男')}</td>
			<td><fmt:formatDate value="${rdlist.rdBirth}" pattern="yyyy-MM-dd"/></td>
			<td><fmt:formatDate value="${rdlist.rdReg}" pattern="yyyy-MM-dd"/></td>
			<td><fmt:formatDate value="${rdlist.rdOver}" pattern="yyyy-MM-dd"/></td>
			<td>${fns:getDictLabel(rdlist.rdState, 'rdstatus', '正常')}</td>
			<td>${rdlist.roler.roleName}</td>
			<td>

				<input type="button" value="选择" onclick="selectAdmin('${rdlist.rdId}', '${rdlist.rdCardno}','${rdlist.rdName}','${fns:getDictLabel(rdlist.rdState, 'rdstatus', '正常')}','${rdlist.roler.roleName}','${rdlist.rdTele}')"/>

			</td>
		</tr>
	</c:forEach>
	</tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>